<?php
namespace User\Controller;
use Think\Controller;

class UserController extends Controller{

    public function add(){
        if(IS_POST) {
            $data['name'] = $_POST['name'];
            $data['tel'] = $_POST['tel'];
            $id = M('user')->add($data);
            if ($id) {
                echo "添加成功，ID为：" . $id;
            } else {

                echo "添加失败";

            }
        }else {
            $this->display();


        }
}


}